<div style="clear: both;"></div>
<hr>
<?php
    defined('_IN_CMS') or die('Fuck off');
    $this->data['article_id'] = $this->data['id'];
    $comments = self::db_query("SELECT * FROM `users00`, `comments00` WHERE (`article` = '".$this->data['id']."' AND `users00`.`id` = `comments00`.`author`) ORDER BY `comments00`.`id` ASC --");
    if (mysql_num_rows($comments) > 0) {
        echo '<h4>&nbsp;Комментарии: </h4>';
        for($i=0; $i<mysql_num_rows($comments); $i++) {
            $this->data['date'] = date("G:i d.m.Y", strtotime(mysql_result($comments, $i, 'date')));
            $this->data['author'] = mysql_result($comments, $i, 'users00.login');
            $this->data['text'] = $this->filter_bb($this->filter_tags(mysql_result($comments, $i, 'text')));
            $this->data['id'] = (int)mysql_result($comments, $i, 'author');
            $this->showMessagesFaceGb($this->data);
        }
    }
    else {
        echo 'Комментариев нет';
    }
    $_SESSION['comment_added'] = '0';

    if (check_session()) {
        echo '
        <form action="'.$_SERVER['REDIRECT_URL'].'" method="POST" name="message">
            <div class="gb_panel_addmsg">
                <div class="auth_col2"><strong>Добавить отзыв </strong></div>
                <div class="auth_col2">';
        include('inc/php/html/tags_bb.php');
        echo '
                </div>
                <div class="auth_col2">
                    <textarea class="gb_input_text" name="article" id="articlei" cols="13" required></textarea>';
                    require('inc/php/js/resize_textarea.js'); 
                    echo 
                    '
                </div>
                <div>
                    <input type="submit" class="button_login gb_button_add" name="add_message_to_gb" value="Добавить">
                    <input type="hidden" name="article_id" value="'.$this->data['article_id'].'">
                    <input type="hidden" name="redirect_url" value="'.$_SERVER['REDIRECT_URL'].'">
                </div>
            </div>
        </form>';

    }
    else {
        echo '<br>Тебе следует войти или зарегистрироваться, если хочешь оставить комментарий<br>';
    }
?>
